<!DOCTYPE html>
<html lang="en">
    <head>
  <meta charset="utf-8" />
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
  <meta name="viewport" content="width=device-width, initial-scale=1" />
  <meta name="format-detection" content="telephone=no" />

  <title>
    Mac OS 安装 etcd | 迪克猪的博客
  </title>

  
  <link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png" />
  <link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png" />
  <link rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16.png" />
  <link rel="manifest" href="/manifest.json" />
  <meta name="theme-color" content="#ffffff" />

  
  <link
    rel="stylesheet"
    href="https://unpkg.com/modern-normalize@0.6.0/modern-normalize.css"
  />

  
  
  
  
  <link rel="stylesheet" href="https://zsy619.github.io/style.min.f7761d111b74dd5c07f0111decee92938c12abc42e0fd319e1a07483e248b54e.css" integrity="sha256-93YdERt03VwH8BEd7O6Sk4wSq8QuD9MZ4aB0g&#43;JItU4=" />

  
  
    
  
</head>

    <body>
        <header id="header">
  <div class="header_container">
    <h1 class="sitetitle">
      <a href="https://zsy619.github.io" title="迪克猪的博客">迪克猪的博客</a>
    </h1>
    <nav class="navbar">
      <ul>
        <li><a href="https://zsy619.github.io">Home</a></li>
        
          <li>
            <a href="/post/">
              
              <span>LINUX性能优化</span>
            </a>
          </li>
        
          <li>
            <a href="/csapp/">
              
              <span>深入理解计算机系统_第三版</span>
            </a>
          </li>
        
          <li>
            <a href="/golang/">
              
              <span>golang</span>
            </a>
          </li>
        
          <li>
            <a href="/docker/">
              
              <span>容器</span>
            </a>
          </li>
        
          <li>
            <a href="/flutter/">
              
              <span>Flutter</span>
            </a>
          </li>
        
          <li>
            <a href="/know/">
              
              <span>知识点</span>
            </a>
          </li>
        
          <li>
            <a href="/categories/">
              
              <span>目录</span>
            </a>
          </li>
        
          <li>
            <a href="/about/">
              
              <span>关于</span>
            </a>
          </li>
        
        <li class="hide-sm"><a href="https://zsy619.github.io/index.xml" type="application/rss+xml">RSS</a></li>
      </ul>
    </nav>
  </div>
</header>

        
<section id="main">
  <article class="post content">
    <h2 class="title">Mac OS 安装 etcd</h2>
    <div class="post_content">
      <h3 id="使用-brew-安装">使用 brew 安装</h3>
<p>第一步： 确定 brew 是否有 etcd 包：</p>
<div class="highlight"><pre style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-shell" data-lang="shell">$ brew search etcd
<span style="color:#f92672">==</span>&gt; Formulae
etcd ✔                                                netcdf                                                pnetcdf

</code></pre></div><p>第二步： 安装</p>
<div class="highlight"><pre style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-shell" data-lang="shell">
$ brew install etcd
Updating Homebrew...
fatal: Could not resolve HEAD to a revision
Warning: You are using macOS 11.0.
We <span style="color:#66d9ef">do</span> not provide support <span style="color:#66d9ef">for</span> this pre-release version.
You will encounter build failures with some formulae.
Please create pull requests instead of asking <span style="color:#66d9ef">for</span> help on Homebrew<span style="color:#e6db74">&#39;s GitHub,
</span><span style="color:#e6db74">Discourse, Twitter or IRC. You are responsible for resolving any issues you
</span><span style="color:#e6db74">experience while you are running this pre-release version.
</span><span style="color:#e6db74">
</span><span style="color:#e6db74">==&gt; Downloading https://mirrors.ustc.edu.cn/homebrew-bottles/bottles/etcd-3.4.13.catalina.bottle.tar.gz
</span><span style="color:#e6db74">######################################################################## 100.0%
</span><span style="color:#e6db74">==&gt; Pouring etcd-3.4.13.catalina.bottle.tar.gz
</span><span style="color:#e6db74">==&gt; Caveats
</span><span style="color:#e6db74">To have launchd start etcd now and restart at login:
</span><span style="color:#e6db74">  brew services start etcd
</span><span style="color:#e6db74">Or, if you don&#39;</span>t want/need a background service you can just run:
  etcd
<span style="color:#f92672">==</span>&gt; Summary
🍺  /usr/local/Cellar/etcd/3.4.13: <span style="color:#ae81ff">8</span> files, 38.7MB

</code></pre></div><h3 id="运行-etcd">运行 etcd</h3>
<p>安装完后，会有相关提示，告知我们怎么使用，推荐使用 brew services 来管理这些应用。</p>
<div class="highlight"><pre style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-shell" data-lang="shell">
$ brew services list
<span style="color:#f92672">==</span>&gt; Tapping homebrew/services
Cloning into <span style="color:#e6db74">&#39;/usr/local/Homebrew/Library/Taps/homebrew/homebrew-services&#39;</span>...
remote: Enumerating objects: 20, <span style="color:#66d9ef">done</span>.
remote: Counting objects: 100% <span style="color:#f92672">(</span>20/20<span style="color:#f92672">)</span>, <span style="color:#66d9ef">done</span>.
remote: Compressing objects: 100% <span style="color:#f92672">(</span>20/20<span style="color:#f92672">)</span>, <span style="color:#66d9ef">done</span>.
remote: Total <span style="color:#ae81ff">932</span> <span style="color:#f92672">(</span>delta 8<span style="color:#f92672">)</span>, reused <span style="color:#ae81ff">5</span> <span style="color:#f92672">(</span>delta 0<span style="color:#f92672">)</span>, pack-reused <span style="color:#ae81ff">912</span>
Receiving objects: 100% <span style="color:#f92672">(</span>932/932<span style="color:#f92672">)</span>, 262.03 KiB | 294.00 KiB/s, <span style="color:#66d9ef">done</span>.
Resolving deltas: 100% <span style="color:#f92672">(</span>383/383<span style="color:#f92672">)</span>, <span style="color:#66d9ef">done</span>.
Tapped <span style="color:#ae81ff">1</span> command <span style="color:#f92672">(</span><span style="color:#ae81ff">27</span> files, 324KB<span style="color:#f92672">)</span>.
Name Status  User Plist
etcd stopped

$ brew services list
Name Status  User Plist
etcd stopped

</code></pre></div><p>brew services 常用的操作</p>
<div class="highlight"><pre style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-shell" data-lang="shell">
<span style="color:#75715e"># 启动某个应用，这里用 etcd 做演示</span>
brew services start etcd

<span style="color:#75715e"># 停止某个应用</span>
brew services stop etcd

<span style="color:#75715e"># 查看当前应用列表</span>
brew services list

</code></pre></div><p>启动 etcd：</p>
<div class="highlight"><pre style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-shell" data-lang="shell">
$ brew services start etcd
<span style="color:#f92672">==</span>&gt; Successfully started <span style="color:#e6db74">`</span>etcd<span style="color:#e6db74">`</span> <span style="color:#f92672">(</span>label: homebrew.mxcl.etcd<span style="color:#f92672">)</span>

$ brew services list
Name Status  User      Plist
etcd started zhushuyan /Users/zhushuyan/Library/LaunchAgents/homebrew.mxcl.etcd.plist

</code></pre></div><p>好了， etcd 已经启动了，现在验证下，是否正确的启动：</p>
<div class="highlight"><pre style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-shell" data-lang="shell">
$ etcdctl endpoint health
127.0.0.1:2379 is healthy: successfully committed proposal: took <span style="color:#f92672">=</span> 1.532483ms

</code></pre></div><p>至此，etcd 已经安装完毕。</p>

    </div>
    <div class="info post_meta">
      <time datetime=2020-10-10T09:10:21&#43;0800 class="date">Saturday, October 10, 2020</time>
      
      
    </div>
    <div class="clearfix"></div>
  </article>
  
    <div class="other_posts">
      
      <a href="https://zsy619.github.io/know/brew-update-error/" class="prev">brew update error</a>
      
      
      <a href="https://zsy619.github.io/know/%E9%93%B6%E6%B2%B3%E9%BA%92%E9%BA%9F%E6%93%8D%E4%BD%9C%E7%B3%BB%E7%BB%9F%E8%AE%BE%E7%BD%AEjava%E4%B8%8Ego%E7%B3%BB%E7%BB%9F%E7%8E%AF%E5%A2%83%E5%8F%98%E9%87%8F/" class="next">银河麒麟操作系统设置java与go系统环境变量</a>
      
    </div>
    <aside id="comments">
</aside>

  
</section>

        <a id="back_to_top" title="Go To Top" href="#">
  <span>
    <svg viewBox="0 0 24 24">
      <path fill="none" d="M0 0h24v24H0z"></path>
      <path d="M12 2L4.5 20.29l.71.71L12 18l6.79 3 .71-.71z"></path>
    </svg>
  </span>
</a>

        <footer id="footer">
  <p>
    <span>&copy; 2021 <a href="https://zsy619.github.io" title="迪克猪的博客">迪克猪的博客</a> </span>
    <span>Built with <a rel="nofollow" target="_blank" href="https://gohugo.io">Hugo</a></span>
    <span>Theme by <a rel="nofollow" target="_blank" href="https://github.com/wayjam/hugo-theme-mixedpaper">WayJam</a></span>
  </p>

  <script src="https://zsy619.github.io/js/main.min.8b182175f5874aeed0acc0979345c98d4bde22208ec4f36cc1d6e3102acb4b10.js" integrity="sha256-ixghdfWHSu7QrMCXk0XJjUveIiCOxPNswdbjECrLSxA=" crossorigin="anonymous" async></script>
</footer>

    </body>
</html>
